<?php
/**
 * https://gitee.com/litephp
 * http://www.dazhetu.cn/
 * jay_fun 410136330@qq.com
 * Date: 2019/1/11
 * Time: 15:33
 */

namespace app\admin\controller;

use app\admin\model\Balance;
use app\common\controller\BaseAdmin;
use app\common\model\Balancelog as BalancelogModel;
use LiteAdmin\Music163;
use LiteAdmin\Tree;
use think\db;

/**
 * @title 用户管理
 * Class Music
 * @package app\admin\controller\content
 */
class Xiangqing extends BaseAdmin
{
  public function index(){
      $db = BalancelogModel::alias('u')
          ->order('create_time desc');

      $search = $this->request->get();
      //print_r($search);die;
      // 精准查询
      foreach (['id'] as $field){
          if (isset($search[$field]) && $search[$field] !== ''){
              $db->where($field,'=', $search[$field]);
          }
      }

      return $this->_list($db, true, $search);
  }
    /**
     * @title 删除
     */
    public function del()
    {
        $ids = $this->request->post('ids',false);
        !$ids && $this->error("缺少参数！");

        $this->_del(new BalancelogModel(),$ids);
    }
}